<?php
function db_connect()
{
   //use or create permanent connection
   //a permanent connection means that a check is made 
   //  to see if the connection is already there
   //if so, it is used, otherwise it is created
   //alter username, password and db name when you have created your own
   $db = mysql_pconnect('storo.dcs.gla.ac.uk','kellyjh','0792');
   if ($db)
      //select the database 
      if (mysql_select_db('kellyjh',$db))
         return $db;
   throw new Exception ("Database connection failed, please try later");
}
?>
